#include "filter.h"
#include <stdio.h>
#include <stdlib.h>

void readFile(char* fileName,short* output,int lines){
	FILE * pFile;
	int i;
	char buf[5];
	pFile = fopen (fileName,"r");
	for(i=0;i<lines;i++){
		fgets(buf,5,pFile);
		output[i]=atoi(buf);
	}
	
	fclose(pFile);
	return;
}

void main(void){
	short data[95400];
	short y2[95400];
	FILE * pFile;
	int i;
	readFile("capture3.csv",data,95400);
	filter(data,y2,95400);
	pFile=fopen("output.csv","w+");
	for(i=0;i<95400;i++){
		fprintf(pFile,"%i\n",y2[i]);
	}
	fclose(pFile);
}

